<?php

namespace control;
/*
*员工类
*/

class staffClass extends adIndexClass
{
    /*行政人事-根据部门分类返回部门列表*/
    public function getDeparment()
    {
        $json['departmentId'] = idSelect(array(
            "type"     => "option",
            "title"    => "当前部门",
            "sqlForm"  => "department where type = '" . $this->post['type'] . "'  order by list ",
            "sqlId"    => "id",
            "sqlField" => "name",
        ));
        return json_encode($json, 320);
    }

    /*行政人事-根据部门ID返回职位列表*/
    public function getJob()
    {
        $json['jobId'] = idSelect(array(
            "type"     => "option",
            "title"    => "当前职位",
            "sqlForm"  => "job where departmentId = '" . $this->post['deparmentId'] . "' order by list ",
            "sqlId"    => "id",
            "sqlField" => "name",
        ));
        return json_encode($json, 320);
    }

    /*行政人事-员工管理-根据职位异步加载员工*/
    public function getStaff()
    {
        $json['stid'] = idSelect(array(
            "type"     => "option",
            "title"    => "员工",
            "sqlForm"  => "staff where jobId = '" . $this->post['jobId'] . "'  order by time desc ",
            "sqlId"    => "stid",
            "sqlField" => "name",
        ));
        return json_encode($json, 320);
    }

}
